package com.lagou;

import com.lagou.service.HelloService;
import org.apache.dubbo.rpc.RpcContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

public class XmlConsumerMain {

    public static void main(String[] args) throws IOException, ExecutionException, InterruptedException {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("consumer.xml");
        HelloService helloService = applicationContext.getBean(HelloService.class);
        String result = helloService.sayHello("张三", 100);
        Future future = RpcContext.getContext().getFuture();
        Object o = future.get();
        System.out.println("result:" + result);
        System.out.println("future result:" + o);
    }
}
